// --------------------------------------------------------------------------------------------------------------------
// <copyright file="Waypoint.cs" company="Microsoft Corporation">
// The MIT License (MIT)
// 
// Copyright (c) 2014, Microsoft Corporation
// 
// Permission is hereby granted, free of charge, to any person obtaining a copy
//  of this software and associated documentation files (the "Software"), to deal
//  in the Software without restriction, including without limitation the rights
//  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
//  copies of the Software, and to permit persons to whom the Software is
//  furnished to do so, subject to the following conditions:
// 
// The above copyright notice and this permission notice shall be included in
//  all copies or substantial portions of the Software.
// 
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
//  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
//  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
//  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
//  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
//  THE SOFTWARE.
// </copyright>
// --------------------------------------------------------------------------------------------------------------------
namespace Test.Robotics.Navigation.Metrics.PathPlanningAndTracking
{
    using System;
    using System.Runtime.Serialization;
    using Microsoft.Robotics.Numerics;

    /// <summary>
    /// Waypoint on the map.
    /// </summary>
    [DataContract]
    public struct Waypoint
    {
        /// <summary>
        /// Position and optional heading in map coordinates.
        /// </summary>
        [DataMember]
        public readonly Pose2D Pose;

        /// <summary>
        /// Relation of the Pose to the landmark.
        /// </summary>
        [DataMember]
        public readonly Pose2D RelativeToLandmark;

        /// <summary>
        /// Whether this waypoint has a "ground truth" marker.
        /// </summary>
        [DataMember]
        public readonly bool IsMarked;

        /// <summary>
        /// Landmark ID at this waypoint (it any).
        /// </summary>
        [DataMember]
        public readonly int LandmarkId;

        /// <summary>
        /// Whether this waypoint is in front of a dock (with a heading facing away).
        /// </summary>
        [DataMember]
        public readonly bool IsDock;

        /// <summary>
        /// Initializes a new instance of the Waypoint struct.
        /// </summary>
        /// <param name="pose">Position and optional heading in map coordinates.</param>
        /// <param name="relativeToLandmark">Relation of the Pose to the landmark.</param>
        /// <param name="isMarked">Whether this waypoint has a "ground truth" marker.</param>
        /// <param name="landmarkId">Landmark ID at this waypoint (it any).</param>
        /// <param name="isDock">Whether this waypoint is in front of a dock (with a heading facing away).</param>
        public Waypoint(Pose2D pose, Pose2D relativeToLandmark, bool isMarked, int landmarkId, bool isDock)
        {
            this.Pose = pose;
            this.RelativeToLandmark = relativeToLandmark;
            this.IsMarked = isMarked;
            this.LandmarkId = landmarkId;
            this.IsDock = isDock;
        }
    }
}
